bitkeeper revision 1.1354 (4267978fFQb5kQkxkvTFxgEKkOUzLQ)
authorbren@br260.wolfson.cam.ac.uk <bren@br260.wolfson.cam.ac.uk>
Thu, 21 Apr 2005 12:07:43 +0000 (12:07 +0000)
committerbren@br260.wolfson.cam.ac.uk <bren@br260.wolfson.cam.ac.uk>
Thu, 21 Apr 2005 12:07:43 +0000 (12:07 +0000)
Enable the ProcFS part of grant table only when CONFIG_PROC_FS is defined.
This is also necessary for separate driver domains that contain block
device backend driver and operate in kernel-mode only (thus ProcFS turned off).

Signed-off-by: Bin Ren <bin.ren@cl.cam.ac.uk>
linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c

index 28b2ba6fc73e3adf3ca51be0c1d7cce9b49533ef..0ae2ac6548dee2b7cbab2062c3c8e340dadf27ba 100644 (file)
@@ -53,10 +53,6 @@ static grant_ref_t gnttab_free_head;
 
 static grant_entry_t *shared;
 
-/* /proc/xen/grant */
-static struct proc_dir_entry *grant_pde;
-
-
 /*
  * Lock-free grant-entry allocator
  */
@@ -243,6 +239,14 @@ gnttab_release_grant_reference( grant_ref_t *private_head,
     *private_head = release;
 }
 
+/*
+ * ProcFS operations
+ */
+
+#ifdef CONFIG_PROC_FS
+
+static struct proc_dir_entry *grant_pde;
+
 static int grant_ioctl(struct inode *inode, struct file *file,
                        unsigned int cmd, unsigned long data)
 {
@@ -319,6 +323,7 @@ static int grant_write(struct file *file, const char __user *buffer,
     return -ENOSYS;
 }
 
+#endif /* CONFIG_PROC_FS */
 
 int gnttab_resume(void)
 {
@@ -360,6 +365,7 @@ static int __init gnttab_init(void)
     for ( i = 0; i < NR_GRANT_ENTRIES; i++ )
         gnttab_free_list[i] = i + 1;
     
+#ifdef CONFIG_PROC_FS
     /*
      *  /proc/xen/grant : used by libxc to access grant tables
      */
@@ -376,6 +382,7 @@ static int __init gnttab_init(void)
 
     grant_pde->read_proc  = &grant_read;
     grant_pde->write_proc = &grant_write;
+#endif
 
     printk("Grant table initialized\n");
     return 0;